<?php
include_once(_APP_PATH. "modules/controlls/controllers/params/params_field.php");
class ParamsFieldCheckbox extends ParamsField{

	public function PreparePostData($fieldPostData)
	{
		$fieldPostData = (array) $fieldPostData;
		
		$values = (array)$this->GetParam('values');
		$resValue = array();
		while (list ($postKey, $postVal) = each($fieldPostData))
		{
			if (isset($values[$postVal])) $resValue[$postKey] = $postVal;
		}
		
		return $resValue; 
	}
	
	public function PrepareOutData($fieldData)
	{
		return (array)$fieldData;
	}	

}